<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTradingStreamTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('trading_stream', function (Blueprint $table) {
            $table->increments('trading_stream_id')->comment("交易流水ID,自增");
            $table->integer('user_id')->unsigned()->comment("用户ID");
            $table->string('change')->comment('流水');
            $table->string('info')->comment('流水说明');
            $table->string('type')->comment('交易类型');
            $table->timestamps();
            $table->engine = 'InnoDB';
            $table->index('trading_stream_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('trading_stream');
    }
}
